<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>
</head>
<script type="text/javascript">
function clear1(){
	var date = $("#date").val();
	if(date==""){
		alert("请输入清理日期...！！");
        return false;  // 返回false，a标签就会终止动作，不跳转
    }else{
    	var url = "redis/clear";
    	$.ajax({
		    type: "get",
		    url: url,
		    data: "date="+date,
		    cache: false,
		    async : false,
		    dataType: "json",
		    success: function (data,textStatus){
		    	alert(textStatus);	 
		    	alert("操作行数:"+data);
		    }
		 });
    }
	
}
function restart(){
	var adcode = $("#adcode").val();
	var starttime = $("#starttime").val();
	if(adcode==""){
		alert("请输入任务单编号...");
        return false;  // 返回false，a标签就会终止动作，不跳转
    }else{
    	var url = "redis/restart";
		$.ajax({
		    type: "get",
		    url: url,
		    data: "adcode="+adcode+"&starttime="+starttime,
		    cache: false,
		    async : false,
		    dataType: "json",
		    success: function (data,textStatus){
		    	alert(textStatus);	 
		    	alert(data);
		    }
		 });
    }
	
}
function restartAll(){
    if(confirm("确定要重启吗?")){
    	var url = "redis/restartAll";
    	$.ajax({
    	    type: "get",
    	    url: url,
    	    data: null,
    	    cache: false,
    	    async : false,
    	    dataType: "json",
    	    success: function (data,textStatus){
    	    	alert(textStatus);	 
    	    	alert(data);
    	    }
    	 });
	}
}
</script>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-key"></span> Redis 管理&nbsp;&nbsp;</strong><font color="red">请不要随意操作！</font></div>
  <div class="body-content">
      
      <br>
      <div class="form-group">
        <div class="field">
			<input type="text" class="input w50" id="date" name="date" size="30" placeholder="请输入清理日期(yyyy-MM-dd)" />          
          &nbsp;&nbsp;&nbsp;&nbsp;<button class="button bg-main icon-check-square-o" type="button" onclick="clear1()"> 清理done</button>   
        </div>
      </div>
  </div>
</div>
<br>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-key"></span> 重启单个任务</strong></div>
  <div class="body-content">
      <br>
      <div class="form-group">
        <div class="field">
                                任务单编号：<input type="text" id="adcode" name="adcode" size="50" placeholder="请输入任务单编号" />  
			启动时间：<input name="starttime" id="starttime"  size="30" type="text" placeholder="格式:HH:mm:ss">	
          &nbsp;&nbsp;&nbsp;&nbsp;<button class="button bg-main icon-check-square-o" type="button" onclick="restart()"> 重启</button>   
        </div>
      </div>
  </div>
</div>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-key"></span> 重启全部任务</strong></div>
  <div class="body-content">
      <br>
      <div class="form-group">
        <div class="field">
			&nbsp;&nbsp;&nbsp;&nbsp;<button class="button bg-main icon-check-square-o" type="button" onclick="restartAll()"> 全部重启</button>   
        </div>
      </div>
  </div>
</div>
</body>
</html>